package com.fancon.android.gardenjokesx.entity;

import java.io.Serializable;
import java.util.ArrayList;

import org.json.JSONException;
import org.json.JSONObject;

public class FacebookUser implements Serializable {
	
	private static final long serialVersionUID = 1L;
	private String userId;
	private String facebookId;
	private String accessToken;
	private String username;
	private String imageProfileUrl;
	private String firstNameFB;
	private String middleNameFB;
	private String lastNameFB;
	
	/* Bien chi su dung o man hinh P063*/
	private boolean isChecked;
	
	private ArrayList<String> friends;
	
	
	public FacebookUser() {
		super();
		this.isChecked = false;
	}
	public ArrayList<String> getFriends() {
		return friends;
	}
	public void setFriends(ArrayList<String> friends) {
		this.friends = friends;
	}
	public boolean isChecked() {
		return isChecked;
	}
	public void setChecked(boolean isChecked) {
		this.isChecked = isChecked;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	public String getFacebookId() {
		return facebookId;
	}
	public void setFacebookId(String facebookId) {
		this.facebookId = facebookId;
	}
	
	public String getAccessToken() {
		return accessToken;
	}
	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}
	
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getImageprofile() {
		return imageProfileUrl;
	}
	public void setImageprofile(String url) {
		this.imageProfileUrl = url;
	}
	public String getfirstNameFB() {
		return firstNameFB;
	}
	public void setfirstNameFB(String firstNameFB) {
		this.firstNameFB = firstNameFB;
	}
	public String getmiddleNameFB() {
		return middleNameFB;
	}
	public void setmiddleNameFB(String middleNameFB) {
		this.middleNameFB = middleNameFB;
	}
	public String getlastNameFB() {
		return lastNameFB;
	}
	public void setlastNameFB(String lastNameFB) {
		this.lastNameFB = lastNameFB;
	}
	
	public JSONObject parseToJsonObject(){
		JSONObject jObject = new JSONObject();
		
		//Put data into JsonObject.
		try {
			jObject.put("facebook_id", facebookId);
			jObject.put("facebook_name", username);
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return jObject;
	}
	@Override
	public boolean equals(Object f) {
		// TODO Auto-generated method stub
		if(this.facebookId.equals(((FacebookUser)f).getFacebookId())){
			return true;
		}else{
			return false;
		}
	}

}
